package com.loop.exception;

public class MyOwnException extends Exception {
    public MyOwnException() {
    }

    public MyOwnException(String msg) {
        super(msg);
    }

    public MyOwnException(String message, Throwable cause) {
        super(message, cause);
    }

    public MyOwnException(Throwable cause) {
        super(cause);
    }

    public MyOwnException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
    }

    public void checkAge(int age){
        if (age<0){
            System.out.println("年龄不合法");
        }
    }
}
